<%@ page language="java" contentType="text/html;charset=utf-8" pageEncoding="utf-8"%>

<%@ include file="/core/taglibs2.jsp"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="/core/adminTopMeta.jsp"%>
<script type="text/javascript">
			
	function nameChange(){
		
		var loginName=$("#loginName").val(); 		
		 
		$.getJSON("<%=basePath%>/admin/wealth/ajaxGetMemberByName.shtml",{loginName: loginName},function(result){	 
			 
			//填入新值
			if(result.success==true){
				
				$("#personName").html("代理商姓名:"+result.member.personName);
			}else{
				 
				$("#personName").html("<b  style='color: red;'>代理商不存在</b>");
			} 
		});
		 
		
	}
	$(function() {
	    $('#submit').click(function() {
	    	
	    	var this_ = this;
	    	this_.setAttribute("disabled", true);  
	    	this_.value="请稍等，提交中..."; 
	    	//进度条 
	    	$(".loader").show();
	        $.ajax({
	            url: '<%=basePath%>/admin/wealth/sysPayAdd.shtml',
	            type: 'post',
	            dataType:'json',
	            data: $("#commitForm").serializeArray(),
	            success: function(result) {
	            	  
	            	 if(result.success==true){
	            	 	 alert("充值成功。");
	            		 window.location.href="<%=basePath%>/admin/wealth/sysPayList.shtml";
											} else {
												alert("充值失败。" + result.msg);
												location.reload();//刷新页面   
											}

											//放到回调里
											this_.removeAttribute("disabled");
											this_.value = "  提  交   ";
										}
									});

						});
	});
</script>
</head>

<body oncontextmenu="return false">
	<div class="loader"></div>

	<div class="row">
		<div class="col-md-12">
			<div class="panel">
				<div class="panel-heading text-primary">
					<h3 class="panel-title">
						<i class="fa fa-money"></i> 系统充值 <span class="pull-right">
							<div class="btn-group code">
								<a href="#" class="dropdown-toggle" data-toggle="dropdown" title="Classes used"> </a>
							</div>
						</span>
					</h3>
				</div>

				<!-- /panel body -->
			</div>
		</div>

		<div class="col-md-12">
			<div class="panel panel-primary">
				<div class="panel-heading">
					<h3 class="panel-title  text-white" style="font-size: 17px;">系统充值</h3>
				</div>
				<div class="panel-body">
					<form id="commitForm" name="commitForm" method="post" action="">
						<input type="hidden" name="token" value="${token}" />
						<jodd:form scopes="request">

							<table class="table table-bordered table-hover table-striped display" id="example">

								<tbody>

									<tr>
										<td style="text-align: right;width: 30%;">代理商编号：</td>
										<td><input type="text" id="loginName" name="loginName" onchange="nameChange()" class="form-control form-cascade-control" /> <span id="personName"></span></td>
									</tr>

									<tr>
										<td style="text-align: right;">奖金积分：</td>
										<td><input type="text" id="money" name="money" value="0" class="form-control form-cascade-control" /></td>
									</tr>

									<tr>
										<td style="text-align: right;">报单积分：</td>
										<td><input type="text" id="ele" name="ele" value="0" class="form-control form-cascade-control" /></td>
									</tr>

									<tr>
										<td style="text-align: right;">备注：</td>
										<td><input type="text" id="content" name="content" class="form-control form-cascade-control" /></td>
									</tr>
									<tr>
										<td style="text-align: right;">安全密码：</td>
										<td><input type="password" id="myTwoPassword" class="form-control form-cascade-control" name="myTwoPassword" /></td>
									</tr>
									<tr>
										<td colspan="2">
											<div style="color: red;text-align:center;">
												<div style="color:red;text-align:center">${retMsg}</div>
											</div>
										</td>
									</tr>

									<tr>
										<td colspan="2" style="text-align: center;">

											<button type="button" id="submit" class="btn btn-success ">提 交</button>
											<button type="reset" class="btn btn-warning">重 置</button>
										</td>
									</tr>



								</tbody>


							</table>
						</jodd:form>
					</form>
				</div>
			</div>
			<!-- / Info Panel -->

		</div>

		<!-- /col-md-12 -->
	</div>
	<!--代码高亮end-->



</body>
</html>